/**
 * 我的关注
 * @type {string} GET 
 * @param {string} {openId:微信用户id , pageNo , pageSize }
 */
export function myFollow(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/topic/myFollow', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 相关推荐文章
 * @type {string} GET 
 * @param {string} {openId:微信用户id ,pageNo,pageSize}
 */
export function recommend(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/articles/recommend', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 热门话题
 * @type {string} GET 
 * @param {string} {openId:微信用户id}
 */
export function hotTopic(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/topic/hotTopic', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 文章详情
 * @type {string} GET 
 * @param {string} {id:文章id}
 */
export function info(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/articles/info', data).then(info => {
			resolve(info.result)
		})
	})
}


/**
 * 答疑/科普列表
 * @type {string} GET 
 * @param {string} {openId:openId  type：类型：1文章、2答疑、3视频    category：1脱发知识、2植发知识、3养发知识、4脱发答疑、5植发答疑、6术后答疑  }
 */
export function questionsOrScience(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/articles/questionsOrScience', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 评论区
 * @type {string} GET 
 * @param {string} {id: 文章id }
 */
export function commentArea(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/articles/commentArea', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 发布评论
 * @type {string} POST 
 * @param {string} {id: 文章id }
 */
export function publishComment(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/publishComment', data).then(info => {
			resolve(info.result)
		})
	})
}
/**
 * 删除评论
 * @type {string} POST 
 * @param {string} {openId: 微信openId  commentId:评论id主键（删除评论用) }
 */
export function removeComment(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/removeComment', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 关注
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   topicId：话题id }
 */
export function followTopic(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/topic/followTopic', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 取消关注
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   topicId：话题id }
 */
export function unFollowTopic(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/topic/unFollowTopic', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 点赞
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   articlesId：文章id }
 */
export function like(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/likes/like', data).then(info => {
			resolve(info.result)
		})
	})
}


/**
 * 取消点赞
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   articlesId：文章id }
 */
export function unlike(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/likes/unlike', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 取消点赞
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   commentsId：评论id }
 */
export function commentsLike(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/commentsLike', data).then(info => {
			resolve(info.result)
		})
	})
}


/**
 * 评论取消点赞
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   commentsId：评论id }
 */
export function commentsUnlike(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/commentsUnlike', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 收藏
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   articlesId：文章id }
 */
export function collector(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/favorites/collector', data).then(info => {
			resolve(info.result)
		})
	})

}

/**
 * 取消收藏
 * @type {string} POST 
 * @param {string} {openId: 微信用户id   articlesId：文章id }
 */
export function unCollector(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/favorites/unCollector', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 视频播放量+
 * @type {string} POST 
 * @param {string} {id: 文章id主键 }
 */
export function articlesView(data) {
	return new Promise(resolve => {
		uni.$u.http.post('/applet/articles/view', data).then(info => {
			resolve(info.result)
		})
	})
}

/**
 * 查询话题下的文章
 * @type {string} GET 
 * @param {string} {topicId: 话题id   openId:微信用户id   pageNo   pageSize }
 */
export function articlesList(data) {
	return new Promise(resolve => {
		uni.$u.http.get('/applet/articles/list', data).then(info => {
			resolve(info.result)
		})
	})
}